<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../template/AdminTemplate.xhtml">

    <ui:define name="contentInsert">
        <h3>Delete Venue</h3>
        <p:panel> 
                <h:form>
                    <h4>Select Venue To Delete</h4>
                    <p:ajaxStatus style="width:16px;height:16px;">
                        <f:facet name="start">
                            <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                        </f:facet>
                        <f:facet name="complete">
                            <h:outputText value="" />
                        </f:facet>
                    </p:ajaxStatus>
                    <p:messages />
                    <p:dataTable value="#{stakeholderPerformanceMB.getAllVenues()}" var="venue"
                                 paginator="true"
                                 rows="20">
                        <p:column>
                            <f:facet name="header">Venue Name</f:facet>
                            <h:outputText id="name" value="#{venue.name}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Address</f:facet>
                            <h:outputText id="commissionPercent" value="#{venue.address}"  />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Capacity</f:facet>         
                            <h:outputText value="#{venue.capacityCap}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Latitude</f:facet>
                            <h:outputText value="#{venue.latitude}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Longitude</f:facet>
                            <h:outputText value="#{venue.longitude}" />
                        </p:column>

                        <p:column>
                            <f:facet name="header">Action</f:facet>
                            <h:commandButton  value="Delete" 
                                            onclick="if (!confirm('Are you sure you want to delete #{venue.name}?')) return false"
                                            action="#{stakeholderPerformanceMB.deleteVenue(venue)}"
                                            >
                            </h:commandButton>
                        </p:column>
                    </p:dataTable>
                </h:form>
             </p:panel>
                </ui:define>
</ui:composition>

